package com.atguigu.gulimall.cart.service;

import com.atguigu.gulimall.cart.vo.Cart;
import com.atguigu.gulimall.cart.vo.CartItem;

import java.util.List;
import java.util.concurrent.ExecutionException;

public interface CartService {
    //添加购物车
    CartItem addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    CartItem getCartItem(Long skuId);
    //获取购物车列表
    Cart getCart() throws ExecutionException, InterruptedException;
    //清空购物车数据
    void clearCart(String cartKey);
    //是否选中
    void checkItem(Long skuId, Integer check);
    //更新商品数量
    void changeItemCount(Long skuId, Integer num);

    void delete(Long skuId);
    /**
     * 返回当前用户购物车中已选中的购物项
     * @return
     */
    List<CartItem> getUserCartItems();
}
